﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Timers;

namespace typewriter {
    class twIDE : twPlugin {

        public bool hasTabs = true;

        public twIDE() {
            this.name = "typewriter IDE";
            this.author = "WillWharton.com";
            this.desc = "a dev view for ";
            this.ver = "0.1a";

            tw.loadPlugin(new twTalk());
        }

        public override void tick() {
            
        }

        public override void notify(string name, object o) {
            Frmtype f = (Frmtype)o;
            if (name == "load") {

                f.Width = 800; //save settings somehow
                f.Height = 600;
                f.Location = new Point(200, 200);

                f.FormBorderStyle = FormBorderStyle.Sizable;

            } else if (name == "size") {


                f.rtb.Width = f.tabs.Width = f.Width - 40;
                f.rtb.Left = 10;
                f.tabs.Left = 10;
                if (hasTabs) {
                    f.rtb.Height = f.Height - 130;
                    f.rtb.Top = 58;
                    f.tabs.Visible = true;
                } else {
                    f.rtb.Height = f.Height - 100;
                    f.rtb.Top = 36;
                    f.tabs.Visible = false;
                }

                
            }

        }
    }
}

